package org.example.design.chainofresponsibility.test2;

/**
 * @author huangshen
 * @version 0
 * @description 部门经理处理类
 * @since 2022/2/10 13:47
 */
public class DeptManagerLeaveHandler extends AbstractLeaveHandler {

    public DeptManagerLeaveHandler(String name) {
        this.handlerName = name;
    }

    @Override
    protected boolean resolve(LeaveRequest request) {
        return request.getLeaveDays() >= this.deptManagerApproveThresholdDate;
    }

    @Override
    protected void done(LeaveRequest request) {
        System.out.println("部门经理:" + handlerName + ",已经处理" + request.getName()
                + "的" + request.getLeaveDays() + "日请假申请");
    }

}
